﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Adex;
using System.Data;

namespace MediaMonitor
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DataView dvSql = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
                foreach (DataRowView drvSql in dvSql)
                {
                    RadEditorContactUS.Content = drvSql["ContactUsText"].ToString();
                }
            }
        }

        protected void btnContactUs_Click(object sender, ImageClickEventArgs e)
        {
                Int32 returnValue = 0;
                returnValue = RfController.AdminChangeContactUS(RadEditorContactUS.Content);
                if (returnValue == 1)
                {
                    lblResult.Text = "Text has been changed successfully.";
                    lblResult.ForeColor = System.Drawing.Color.Green;
                    lblResult.Visible = true;
                }
                else if (returnValue == -1)
                {
                    lblResult.Text = "Sorry there was some problem. Please try after some times";
                    lblResult.ForeColor = System.Drawing.Color.Red;
                    lblResult.Visible = true;
                }
        }
    }
}